package com.szrt.day20170421.entity;

public class Student  implements Comparable{
	
	private String idExam;
	
	private String password;
	
	private String name;
	
	private String sex;
	
	private int age;
	
	private String province;
	
	
	
	
	/**
	 * 城市
	 */
	private String huji;
	
	private String phone;
	
	private int  chineseScore;
	private int  mathScore;
	private int  englishScore;
	
	
	public Student(){}
	
	public Student(String idExam, String password, String name, String sex, 
			int age, String province, String huji,
			String phone, int chineseScore, int mathScore, int englishScore) {
		super();
		this.idExam = idExam;
		this.password = password;
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.province = province;
		this.huji = huji;
		this.phone = phone;
		this.chineseScore = chineseScore;
		this.mathScore = mathScore;
		this.englishScore = englishScore;
	}
	
	@Override
	public String toString() {
		return "语文成绩="
				+ chineseScore +"Student [idExam=" + idExam + ", password=" + password + ", name=" + name + ", sex=" + sex + ", age="
				+ age + ", province=" + province + ", huji=" + huji + ", phone=" + phone + ", 语文成绩="
				+ chineseScore + ", mathScore=" + mathScore + ", englishScore=" + englishScore + "]";
	}
	
	
	public String getIdExam() {
		return idExam;
	}
	public void setIdExam(String idExam) {
		this.idExam = idExam;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getHuji() {
		return huji;
	}
	public void setHuji(String huji) {
		this.huji = huji;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public int getChineseScore() {
		return chineseScore;
	}
	public void setChineseScore(int chineseScore) {
		this.chineseScore = chineseScore;
	}
	public int getMathScore() {
		return mathScore;
	}
	public void setMathScore(int mathScore) {
		this.mathScore = mathScore;
	}
	public int getEnglishScore() {
		return englishScore;
	}
	public void setEnglishScore(int englishScore) {
		this.englishScore = englishScore;
	}

	@Override
	public int compareTo(Object o) {
		
		Student cf = (Student) o; 
		
		int myselfScore = getChineseScore()+ getEnglishScore()+getMathScore();
		int cfScore = cf.getChineseScore()+cf.getEnglishScore()+cf.getMathScore();
		
		
		return  cfScore - myselfScore;
	}
	
	
	

}
